require([ "dojo/parser", "dojo/store/Memory", "gridx/Grid",
		"gridx/core/model/cache/Sync", "gridx/allModules",
		"gridx/support/Summary", "gridx/support/LinkPager",
		"gridx/support/LinkSizer", "gridx/support/DropDownPager",
		"gridx/support/DropDownSizer", "gridx/support/GotoPageButton",
		"gridx/support/QuickFilter", "dijit/Toolbar", "dijit/form/Button", "dijit/TitlePane","dojo/domReady!" ], function(parser,
		Store, Grid, Cache, modules, Summary, LinkPager, LinkSizer,
		DropDownPager, DropDownSizer, GotoPageButton, QuickFilter,Toolbar, Button, TitlePane) {
	mods = [
			modules.ExtendedSelectRow,
			modules.IndirectSelectColumn,
			modules.Pagination,
			//modules.PaginationBar,
			modules.Filter,
			modules.Bar
		];
	
	 store = new Store({
		data : [ {
			id : 1,
			title : 'Hey There',
			artist : 'Bette Midler'
		}, {
			id : 2,
			title : 'Love or Confusion',
			artist : 'Jimi Hendrix'
		}, {
			id : 3,
			title : 'Sugar Street',
			artist : 'Andy Narell'
		}, {
			id : 4,
			title : 'Sugar Street',
			artist : 'Andy Narell'
		}, {
			id : 5,
			title : 'Sugar Street',
			artist : 'Andy Narell'
		}, {
			id : 6,
			title : 'Sugar Street',
			artist : 'Andy Narell'
		}, {
			id : 7,
			title : 'Sugar Street',
			artist : 'Andy Narell'
		}, {
			id : 8,
			title : 'Sugar Street',
			artist : 'Andy Narell'
		}, {
			id : 9,
			title : 'Sugar Street',
			artist : 'Andy Narell'
		}, {
			id : 10,
			title : 'Sugar Street',
			artist : 'Andy Narell'
		}, {
			id : 11,
			title : 'Sugar Street',
			artist : 'Andy Narell'
		}, {
			id : 12,
			title : 'Sugar Street',
			artist : 'Andy Narell'
		}, {
			id : 13,
			title : 'Sugar Street',
			artist : 'Andy Narell'
		}, {
			id : 14,
			title : 'Sugar Street',
			artist : 'Andy Narell'
		}, {
			id : 15,
			title : 'Sugar Street',
			artist : 'Andy Narell'
		}, {
			id : 16,
			title : 'Sugar Street',
			artist : 'Andy Narell'
		}, {
			id : 17,
			title : 'Sugar Street',
			artist : 'Andy Narell'
		}, {
			id : 18,
			title : 'Sugar Street',
			artist : 'Andy Narell'
		}, {
			id : 19,
			title : 'Sugar Street',
			artist : 'Andy Narell'
		}, {
			id : 20,
			title : 'Sugar Street',
			artist : 'Andy Narell'
		}, {
			id : 21,
			title : 'Sugar Street',
			artist : 'Andy Narell'
		}, {
			id : 22,
			title : 'Sugar Street',
			artist : 'Andy Narell'
		}, {
			id : 23,
			title : 'Sugar Street',
			artist : 'Andy Narell'
		}, {
			id : 24,
			title : 'Sugar Street',
			artist : 'Andy Narell'
		}, {
			id : 25,
			title : 'Sugar Street',
			artist : 'Andy Narell'
		}, {
			id : 26,
			title : 'Sugar Street',
			artist : 'Andy Narell'
		}, {
			id : 27,
			title : 'Sugar Street',
			artist : 'Andy Narell'
		}, {
			id : 28,
			title : 'Sugar Street',
			artist : 'Andy Narell'
		}, {
			id : 29,
			title : 'Sugar Street',
			artist : 'Andy Narell'
		}, {
			id : 30,
			title : 'Sugar Street',
			artist : 'Andy Narell'
		}, {
			id : 31,
			title : 'Sugar Street',
			artist : 'Andy Narell'
		}, {
			id : 32,
			title : 'Sugar Street',
			artist : 'Andy Narell'
		}, {
			id : 33,
			title : 'Sugar Street',
			artist : 'Andy Narell'
		}, {
			id : 34,
			title : 'Sugar Street',
			artist : 'Andy Narell'
		}, {
			id : 35,
			title : 'Sugar Street',
			artist : 'Andy Narell'
		}, {
			id : 36,
			title : 'Sugar Street',
			artist : 'Andy Narell'
		}, {
			id : 37,
			title : 'Sugar Street',
			artist : 'Andy Narell'
		}, {
			id : 38,
			title : 'Sugar Street',
			artist : 'Andy Narell'
		}, {
			id : 39,
			title : 'Sugar Street',
			artist : 'Andy Narell'
		}, {
			id : 40,
			title : 'Sugar Street',
			artist : 'Andy Narell'
		}, {
			id : 41,
			title : 'Sugar Street',
			artist : 'Andy Narell'
		}, {
			id : 42,
			title : 'Sugar Street',
			artist : 'Andy Narell'
		}, {
			id : 43,
			title : 'Sugar Street',
			artist : 'Andy Narell'
		}, {
			id : 44,
			title : 'Sugar Street',
			artist : 'Andy Narell'
		}, {
			id : 45,
			title : 'Sugar Street',
			artist : 'Andy Narell'
		}, {
			id : 46,
			title : 'Sugar Street',
			artist : 'Andy Narell'
		}, {
			id : 47,
			title : 'Sugar Street',
			artist : 'Andy Narell'
		}, {
			id : 48,
			title : 'Sugar Street',
			artist : 'Andy Narell'
		}, {
			id : 49,
			title : 'Sugar Street',
			artist : 'Andy Narell'
		}, {
			id : 50,
			title : 'Sugar Street',
			artist : 'Andy Narell'
		}, {
			id : 51,
			title : 'Sugar Street',
			artist : 'Andy Narell'
		}, ]
	});

	 layout = [ {
		field : "id",
		name : "标识符"
	}, {
		field : "title",
		name : "标题"
	}, {
		field : "artist",
		name : "作者"
	} ];
	 
	 var gridToolbar = new Toolbar({});
	 gridToolbar.addChild(new Button({
		label: '增加',
		onClick: function(){
			alert('cut');
		}
	}));	 
	 
	gridTop = [
	          	gridToolbar,
	    		{pluginClass: QuickFilter, 'className': 'quickFilter'}
	    	];	 
	gridBottom = [
	       		[
	       		 	{pluginClass: Summary},
	       		      {pluginClass: LinkPager, 'className': 'linkPager'},
	       			{pluginClass: DropDownPager},
	       			'gridx/support/DropDownSizer',
	       			GotoPageButton
	       		]
	       	];	 
	
	parser.parse();
});